Skip to content

fix: resolve all test failures and type errors#6

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2293-1779433732
Open

fix: resolve all test failures and type errors#6
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2293-1779433732

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

Fixes all failing tests (22 tests now pass) and eliminates all TypeScript type errors across the api and shared packages.

Changes

  • Auth middleware (packages/api/src/middleware/auth.ts) — Fixed case-sensitivity bug in HTTP method comparison. The middleware was comparing request methods without normalizing case, causing POST requests to be incorrectly blocked by auth.
  • Shared types (packages/shared/src/types.ts) — Renamed userNameusername and emailAddressemail to match the field names used throughout the API routes and tests.
  • Users route (packages/api/src/routes/users.ts) — Added missing badRequest import from the errors library.
  • Pagination utility (packages/shared/src/utils/pagination.ts) — Implemented the paginate function (was previously a stub throwing "not implemented").
  • TypeScript config (tsconfig.json) — Added bun-types to compiler options for proper process type resolution.

Verification

bun test → 22 pass, 0 fail, 37 expect() calls
npx tsc --noEmit → no errors

Assumptions

  • No test files were modified
  • No new dependencies were added
  • Field renames in the shared User type are safe since all consumers (routes + tests) use the new names

…packages

- Fix auth middleware case-sensitivity bug (normalize HTTP method comparison)
- Rename User type fields (userName→username, emailAddress→email) for consistency
- Add missing badRequest import in users route handler
- Implement paginate utility function in shared package
- Add bun-types to tsconfig for proper type resolution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant